package com.lazy.mapper;


import com.lazy.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface StudentMapper {
    /**
     * 根据用户名查询用户
     */
    @Select("select * from student where username=#{username}")
    Student getByUsername(String username);

    /**
     * 插入学生数据
     */
    @Insert("insert into student(username, password, phone, sex, createTime, updateTime) VALUES " +
            "(#{username} ,#{password} ,#{phone},#{sex},#{createTime},#{updateTime})")
    void insert(Student student);

    @Select("select * from student where id = #{id} ")
    Student selectById(Long id);
}
